package com.project.imageinterference.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 分页对象
 */
public class Paging<T> implements Serializable {

    private static final long serialVersionUID = 7544274721272147458L;

    private Long total;

    private List<T> data = new ArrayList<>();

    //喜讯待审核总数
    private Long examine_total;

    /**
     * 无任何参数的构造方法，用于远程RPC序列化
     */
    public Paging(){}
    public Paging(Long total, List<T> data){
        this.total = total;
        this.data = data;
    }

    /**
     * 构建空分页对象
     * @param <T>
     * @return
     */
    public static <T> Paging<T> empty() {
        return new Paging<T>(0L, Collections.<T>emptyList());
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public void addData(T data){
        this.data.add(data);
    }
    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Long getExamine_total() {
        return examine_total;
    }

    public void setExamine_total(Long examine_total) {
        this.examine_total = examine_total;
    }
}